#pragma once

#include <QWidget>
#include"Song.h"
#include"OnlionMusicInfo.h"
class MusicListDelegate;
class MusicListView;
class QStandardItemModel;
class MusicListDelegate;


class SearchList  : public QWidget
{
	Q_OBJECT

public:
	SearchList(QWidget *parent = nullptr);
	~SearchList();

	//void appendSong(const Song& song);
	void appendSong(const QList<Song>& list);
	void appendSong(const QList< OnlionMusicInfo>& infos);
	void appendUrl(const QList<QUrl>& urlList);
	void push_back(const QList<Song>& list);
	void push_back(const QList< OnlionMusicInfo>& infos);
	void scrollTop();
signals:
	void mouseLeftDoubleClicked(Song s);
private:
	QStandardItemModel* m_model;
	MusicListView* m_listView;
	MusicListDelegate* m_delegate;

	void initConnect();
};

